from base.base_filters import BaseFilter


class MenuFilter(BaseFilter):

    @staticmethod
    def filter_title(queryset, value):
        return queryset.filter(title__icontains=value)


class VisitorFilter(BaseFilter):

    @staticmethod
    def filter_ip(queryset, value):
        return queryset.filter(ip__icontains=value)

    @staticmethod
    def filter_country(queryset, value):
        return queryset.filter(country__icontains=value)

    @staticmethod
    def filter_region(queryset, value):
        return queryset.filter(region__icontains=value)

    @staticmethod
    def filter_city(queryset, value):
        return queryset.filter(city__icontains=value)
